/*
 * Universidade Federal Fluminense
 * Instituto de Computação
 * Prof. Pedro Braconnot Velloso
 * Sistemas Distribuídos - Turma 2011/2
 * Author: Gabriel Almeida de Oliveira
 * Description: default constants header
 */

#ifndef _CONST_
#define _CONST_

	// Libs for treating input, output, memory, strings, errors...
	#include <stdio.h>
	#include <stdlib.h>
	#include <string.h>
	#include <unistd.h>
	#include <errno.h>
	#include <sys/wait.h>

	// Socket-Specific Libraries
	#include <sys/socket.h>		// socket(); connect(); send(); recv()
	#include <sys/types.h>		// sockaddr_in; inet_addr()
	#include <netinet/in.h>
	#include <arpa/inet.h>
	#include <netdb.h>

	
	// Port Related
	#define DEFAULT_PORT	6666
	#define MIN_PORT_RANGE	1024	// Start port range for UDP socket
	#define MAX_PORT_RANGE	65535	// End port range for UDP socket

	// Errorlevel
	#define OK	0
	#define ERROR_INVALID_ARGS			-1
	#define ERROR_INVALID_HOST			-2
	#define ERROR_COULDNT_OPEN_SOCKET	-3
	#define ERROR_DIE_WITH_ERROR		-255

	// Socket Related
	#define MAX_MSG_SIZE	250	// Maximum size of the message
	#define MAXHOSTSIZE		100	// Maximum size of the Host name
    #define KEY_MAX_SIZE  	50	// Maxium size of the shared key	
	#define MAX_PEER_NUMBER 5	// Maximum number of simultaneous peers (EXPERIMENTAL)
	
	//Peer Runlevel
	#define PEER_IN 	 -10	// Peer entered via this node, I need to tell all my neighbors
	#define PEER_OUT	 -13	// Peer left and only told me, I need to tell all my neighbors
	#define KILL_APP		 -20	// Send kill command to my neighbors and shut down
			
	// TCP Related
//	#define MSG_OOB			0x1		// process out-of-band data
//	#define MSG_DONTROUTE	0x4		// bypass routing, usedirect interface
//	#define MSG_DONTWAIT	0x40	// don't block
//	#define MSG_NOSIGNAL	0x2000	// don't raise SIGPIPE
    
    // Shared Key 

	
#endif